package hexgame;

public abstract class Player {
	HexPlayer player;
	
	/**
	 * Is the player still connected?
	 * Mostly only valid for remote clients.
	 * @return true or false
	 */
	public abstract boolean isConnected();
	
	/**
	 * Gets the next move from the player.
	 * @return The move calculated / retrieved. Return null if the game should stop due to error
	 */
	public abstract HexMove getMove();
	
	/**
	 * Used to display new moves and send moves to remote clients
	 * @param HexMove - the move played by the opposing player.
	 */
	public abstract void showMove(HexMove move);
	
	/**
	 * Display a winning message / send YouWin, Bye and clean up
	 * @param didWin - did this player win?
	 */
	public abstract void gameOver(boolean didWin);
	
	/**
	 * 	Used to display error messages locally. AI or remote players won't do anything with this
	 * @param message - the error message to be displayed
	 */
	public abstract void sendErrorMessage(String message);
	 
	
	/**
	 * Sets the player type (red or blue) for the current player object
	 * @param player type
	 */
	public void setPlayer(HexPlayer player) {
		this.player = player;
	}
	

}
